package com.nali.spreader.dao.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.orm.ibatis.SqlMapClientTemplate;
import org.springframework.stereotype.Repository;

import com.nali.spreader.dao.ICrudClientActionDao;
import com.nali.spreader.model.ClientAction;
import com.nali.spreader.model.ClientActionExample;

@Repository
public class CrudClientActionDao implements ICrudClientActionDao {

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Wed Jul 20 16:30:56 CST 2011
     */
    public CrudClientActionDao() {
        super();
    }

    /**
     * This field was generated by Apache iBATIS ibator.
     * This field corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    @Autowired
    private SqlMapClientTemplate sqlMap;

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public int countByExample(ClientActionExample example) {
        Integer count = (Integer) getSqlMapClientTemplate().queryForObject("spreader_tb_client_action.ibatorgenerated_countByExample", example);
        return count;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public int deleteByExample(ClientActionExample example) {
        int rows = getSqlMapClientTemplate().delete("spreader_tb_client_action.ibatorgenerated_deleteByExample", example);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public int deleteByPrimaryKey(Long id) {
        ClientAction key = new ClientAction();
        key.setId(id);
        int rows = getSqlMapClientTemplate().delete("spreader_tb_client_action.ibatorgenerated_deleteByPrimaryKey", key);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public void insert(ClientAction record) {
        getSqlMapClientTemplate().insert("spreader_tb_client_action.ibatorgenerated_insert", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public void insertSelective(ClientAction record) {
        getSqlMapClientTemplate().insert("spreader_tb_client_action.ibatorgenerated_insertSelective", record);
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    @SuppressWarnings("unchecked")
    public List<ClientAction> selectByExampleWithBLOBs(ClientActionExample example) {
        List<ClientAction> list = getSqlMapClientTemplate().queryForList("spreader_tb_client_action.ibatorgenerated_selectByExampleWithBLOBs", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    @SuppressWarnings("unchecked")
    public List<ClientAction> selectByExampleWithoutBLOBs(ClientActionExample example) {
        List<ClientAction> list = getSqlMapClientTemplate().queryForList("spreader_tb_client_action.ibatorgenerated_selectByExample", example);
        return list;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public ClientAction selectByPrimaryKey(Long id) {
        ClientAction key = new ClientAction();
        key.setId(id);
        ClientAction record = (ClientAction) getSqlMapClientTemplate().queryForObject("spreader_tb_client_action.ibatorgenerated_selectByPrimaryKey", key);
        return record;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public int updateByExampleSelective(ClientAction record, ClientActionExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_client_action.ibatorgenerated_updateByExampleSelective", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public int updateByExampleWithBLOBs(ClientAction record, ClientActionExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_client_action.ibatorgenerated_updateByExampleWithBLOBs", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public int updateByExampleWithoutBLOBs(ClientAction record, ClientActionExample example) {
        UpdateByExampleParms parms = new UpdateByExampleParms(record, example);
        int rows = getSqlMapClientTemplate().update("spreader_tb_client_action.ibatorgenerated_updateByExample", parms);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public int updateByPrimaryKeySelective(ClientAction record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_client_action.ibatorgenerated_updateByPrimaryKeySelective", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public int updateByPrimaryKeyWithBLOBs(ClientAction record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_client_action.ibatorgenerated_updateByPrimaryKeyWithBLOBs", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public int updateByPrimaryKeyWithoutBLOBs(ClientAction record) {
        int rows = getSqlMapClientTemplate().update("spreader_tb_client_action.ibatorgenerated_updateByPrimaryKey", record);
        return rows;
    }

    /**
     * This method was generated by Apache iBATIS ibator.
     * This method corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    public SqlMapClientTemplate getSqlMapClientTemplate() {
        return sqlMap;
    }

    /**
     * This class was generated by Apache iBATIS ibator.
     * This class corresponds to the database table spreader.tb_client_action
     *
     * @ibatorgenerated Thu Aug 04 16:40:12 CST 2011
     */
    private static class UpdateByExampleParms extends ClientActionExample {

        private Object record;

        public UpdateByExampleParms(Object record, ClientActionExample example) {
            super(example);
            this.record = record;
        }

        public Object getRecord() {
            return record;
        }
    }
}
